<style>
.fui-list-inner .vip {
	background: #09ba07 none repeat scroll 0 0;
    color: #fff;
    position: absolute;
    margin-left: 0.2rem;
    height: 0.75rem;
    width: 0.75rem;
    vertical-align: top;
    z-index: 100;
    line-height: 1.1;
    text-align: center;
    border-radius: 0.85rem;
}
.item-up-content {background-color: #fff;border-radius: 10px;padding:0.5rem;margin:0.5rem}
.weui_cells {padding:0;margin-top:0}
.weui_cell_bd {padding:0;padding-bottom:0.3rem;padding-top:0.3rem;color:#999;font-size:0.6rem}
.weui_cell_hd {font-size:0.6rem;padding-bottom:0.3rem;padding-top:0.3rem;margin-right:0.3rem}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
	<div class="fui-content">
		<div class="fui-cell-group fui-cell-click" style="margin-top:0">
				<div class="fui-cell">
					<div class="fui-cell-info">
						<div class="fui-cell-info text bold" style="font-size:1.2rem;color:#333">邀请访客</div>
						<div class="subtitle" style="font-size:0.5rem;margin-top:0.3rem">邀请访客到{{pagedata.house.building.area ||'深圳小周邻城'}}{{pagedata.house.building.qishu}}{{pagedata.house.dongshu}}栋{{ifelse(pagedata.house.danyuan,pagedata.house.danyuan+'单元','')}}{{pagedata.house.room_num}}</div>
					</div>
				</div>
		</div>
		<div class="fui-cell-group" style="padding:0.5rem">
				<div ng-repeat="item in pagedata.guests" class="fui-cell" ng-click="access_json('/setguest/detail/id='+item.id)">
					<div class="fui-cell-text" style="color:#333;">
						<div>{{item.guestname || '小周'}}{{ifelse(item.sex==1,'女士','先生')}}</div>
						<div class="subtitle">预约到访时间：{{item.time}}</div>
					</div>
					<div class="fui-cell-remark noremark" style="color:#00c568">{{item.status==1?'已到访' : '尚未到访'}}</div>
				</div>
		</div>
		<div class="weui_btn weui_btn_primary" style="margin:0.5rem 2rem" href="javascript:" ng-click="access_json('add')">去邀请</div>
</div>
</div>
<div class="fui-page fui-page-current" ng-if="pagedata.op=='add'">
	<div class="fui-content">
		<div class="fui-cell-group fui-cell-click" style="margin-top:0">
				<div class="fui-cell">
					<div class="fui-cell-info">
						<div class="fui-cell-info text bold" style="font-size:1.2rem;color:#333">新邀请</div>
						<div class="subtitle" style="font-size:0.5rem;margin-top:1rem">邀请访客到{{pagedata.house.building.area ||'深圳小周邻城'}}{{pagedata.house.building.qishu}}{{pagedata.house.dongshu}}栋{{ifelse(pagedata.house.danyuan,pagedata.house.danyuan+'单元','')}}{{pagedata.house.room_num}}</div>
					</div>
				</div>
		</div>
		<div class="weui_cells weui_cells_form">
            <div class="weui_cell weui_select_after">
                <div class="weui_cell_hd"><label class="weui_label">访客姓名</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入" ng-model="pagedata.post.name">
                </div>
            </div>
			<div class="weui_cell weui_cell_select weui_select_after">
                <div class="weui_cell_hd">
                    访客性别
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="select2" ng-model="pagedata.post.sex">
                        <option  value="1">女士</option>
                        <option value="2">男士</option>
                    </select>
                </div>
            </div>
			<div class="weui_cell weui_cell_select weui_select_after">
                <div class="weui_cell_hd">
                    来访人数
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="select2" ng-model="pagedata.post.num">
                        <option value="1">1人</option>
                        <option value="2">2人</option>
						<option value="3">3人</option>
						<option value="4">4人</option>
						<option value="5">5人以上</option>
                    </select>
                </div>
            </div>
			<div class="weui_cell weui_select_after">
                <div class="weui_cell_hd"><label for="" class="weui_label">到访时间</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="date" id='uptime'>
                </div>
            </div>
            <div class="weui_cell weui_select_after">
                <div class="weui_cell_hd"><label class="weui_label">来访事由</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入" ng-model="pagedata.post.content">
                </div>
            </div>
			<div class="weui_cell weui_cell_switch weui_select_after">
                <div class="weui_cell_hd weui_cell_primary">是否驾车</div>
                <div class="weui_cell_ft">
                    <input class="weui_switch" type="checkbox" value="true" ng-model="pagedata.post.iscar">
                </div>
			</div>
        </div>
		<div class="weui_btn weui_btn_primary" style="margin:1rem 2rem" href="javascript:" ng-click="pagedata.subpost();">提交邀请</div>
	</div>
</div>
<div class="fui-page fui-page-current" ng-if="pagedata.op=='detail'">
	<div class="fui-content">
		<div class="fui-cell-group fui-cell-click" style="margin:1rem">
				<div class="fui-cell">
					<div class="fui-cell-info" style="text-align:center">
						<div class="subtitle" style="margin-top:0.5rem">我邀请了</div>
						<div class="fui-cell-info text bold" style="font-size:1.2rem;color:#333;margin-top:0.5rem">{{pagedata.item.guestname || '小周'}}{{ifelse(pagedata.item.sex==1,'女士','先生')}}</div>
						<div class="subtitle" style="font-size:0.5rem;margin-top:0.5rem">到访{{pagedata.house.building.area ||'深圳小周邻城'}}{{pagedata.house.building.qishu}}{{pagedata.house.dongshu}}栋{{ifelse(pagedata.house.danyuan,pagedata.house.danyuan+'单元','')}}{{pagedata.house.room_num}}</div>
						<div class="text" style="margin:0.5rem">"{{pagedata.item.shiyou || '有朋之远方来'}}"</div>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-info">
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<span>来访人数</span>
							</div>
							<div class="weui_cell_ft">{{pagedata.item.num || '1'}}人</div>
						</div>
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<span>有效期至</span>
							</div>
							<div class="weui_cell_ft">{{pagedata.item.time || '2019-05-01 10:00'}}</div>
						</div>
						<div class="weui_cell">
							<div class="weui_cell_bd weui_cell_primary">
								<span>是否驾车</span>
							</div>
							<div class="weui_cell_ft">{{ifelse(pagedata.item.iscar==1,'驾车','未驾车')}}</div>
						</div>
					</div>
				</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.pagedata.subpost=function(){
	var uptime=$('#uptime').val();
	scope.pagedata.post.time=uptime;
	if(!scope.pagedata.post.name){
		scope.message('访客名称不能为空！','error');
		return false
	}
	if(!scope.pagedata.post.time){
		scope.message('访问时间不能为空！','error');
		return false
	}
	scope.post_json('submit',scope.pagedata.post)
}
</script>